﻿<Window x:Class="Bymed.SpineScan.WPF.ReportDesignWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:userControl="clr-namespace:Bymed.SpineScan.WPF.CustomizedUserControl"
        Title="ReportDesignWindow" Height="1122.56" Width="793.76">
    <Grid Height="1090" Margin="12,12,0,0">
        <Grid.RowDefinitions>
            <!-- Report Header -->
            <RowDefinition Height="Auto" />
            <!-- Report Result Indicator -->
            <RowDefinition Height="45" />
            <!-- Test Result -->
            <RowDefinition />
            <!-- Diagnostic Messages -->
            <RowDefinition Height="Auto" />
            <!-- Footer -->
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <userControl:TestResultReportHeaderUserControl Margin="0,10,0,0" DataContext="{Binding}" />
        <StackPanel Grid.Row="1" Orientation="Horizontal" VerticalAlignment="Bottom" Margin="16,0,0,3">
            <TextBlock Margin="0,0,10,0" VerticalAlignment="Center" Text="检测结果" Style="{StaticResource TestReportTextBlock}" />
            <Border Margin="0,0,5,0" Background="{StaticResource TestReportUnusualRangeBackgroundBrush}" Style="{StaticResource TestReportResultIndicatorBorder}"  />
            <TextBlock Margin="0,0,20,0" VerticalAlignment="Center" Text="异常" Foreground="Black" Style="{StaticResource TestReportTextBlock}" />
            <Border Margin="0,0,5,0" Background="{StaticResource TestReportNormalRangeBackgroundBrush}" Style="{StaticResource TestReportResultIndicatorBorder}" />
            <TextBlock Margin="0,0,20,0" VerticalAlignment="Center" Text="正常" Foreground="Black" Style="{StaticResource TestReportTextBlock}" />
        </StackPanel>
        <StackPanel Grid.Row="2" Margin="10,5,10,10" Width="750">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                <userControl:TestResultRegularChartUserControl Margin="0,0,0,15" DataContext="{Binding ScoliosisATI}" Style="{StaticResource TestResultRegularChartUserControlStyle}" />
                <userControl:TestResultRegularChartUserControl Grid.Row="1" Margin="0,0,0,15" DataContext="{Binding Kyphosis}" Style="{StaticResource TestResultRegularChartUserControlStyle}" />
                <!-- Cervical Activities -->
                <Grid Grid.Row="2" Margin="0,0,0,15">
                    <Grid.Style>
                        <Style TargetType="{x:Type Grid}">
                            <Style.Triggers>
                                <MultiDataTrigger>
                                    <MultiDataTrigger.Conditions>
                                        <Condition Binding="{Binding CervicalFlexExt.NeedDetailReport}" Value="False" />
                                        <Condition Binding="{Binding CervicalLateralBending.NeedDetailReport}" Value="False" />
                                        <Condition Binding="{Binding CervicalRotation.NeedDetailReport}" Value="False" />
                                    </MultiDataTrigger.Conditions>
                                    <Setter Property="Visibility" Value="Collapsed" />
                                </MultiDataTrigger>
                            </Style.Triggers>
                        </Style>
                    </Grid.Style>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>
                    <Border Grid.RowSpan="3" Width="40" Background="{StaticResource TestReportMainBackgroundBrush}">
                        <TextBlock Width="30" TextAlignment="Center" Text="颈部活动度" Style="{StaticResource TestReportTitleTextBlock}" />
                    </Border>
                    <userControl:TestResultRegularChartUserControl Grid.Column="1" VerticalAlignment="Top" Margin="0,0,0,5" DataContext="{Binding CervicalLateralBending}" />
                    <userControl:TestResultRegularChartUserControl Grid.Column="1" Grid.Row="1" Margin="0,0,0,5" DataContext="{Binding CervicalFlexExt}" />
                    <userControl:TestResultRegularChartUserControl Grid.Column="1" Grid.Row="2" VerticalAlignment="Bottom" DataContext="{Binding CervicalRotation}" />
                </Grid>
                <!-- Thoracic Activities -->
                <Grid Grid.Row="3" Margin="0,0,0,15">
                    <Grid.Style>
                        <Style TargetType="{x:Type Grid}">
                            <Style.Triggers>
                                <MultiDataTrigger>
                                    <MultiDataTrigger.Conditions>
                                        <Condition Binding="{Binding ThoracicFlexExt.NeedDetailReport}" Value="False" />
                                        <Condition Binding="{Binding ThoracicLateralBending.NeedDetailReport}" Value="False" />
                                        <Condition Binding="{Binding ThoracicRotation.NeedDetailReport}" Value="False" />
                                    </MultiDataTrigger.Conditions>
                                    <Setter Property="Visibility" Value="Collapsed" />
                                </MultiDataTrigger>
                            </Style.Triggers>
                        </Style>
                    </Grid.Style>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>
                    <Border Grid.RowSpan="3" Width="40" Background="{StaticResource TestReportMainBackgroundBrush}">
                        <TextBlock Width="30" TextAlignment="Center" Text="胸部活动度" Style="{StaticResource TestReportTitleTextBlock}" />
                    </Border>
                    <userControl:TestResultRegularChartUserControl Grid.Column="1" VerticalAlignment="Top" Margin="0,0,0,5" DataContext="{Binding ThoracicLateralBending}" />
                    <userControl:TestResultRegularChartUserControl Grid.Column="1" Grid.Row="1" Margin="0,0,0,5" DataContext="{Binding ThoracicFlexExt}" />
                    <userControl:TestResultRegularChartUserControl Grid.Column="1" Grid.Row="2" VerticalAlignment="Bottom" DataContext="{Binding ThoracicRotation}" />
                </Grid>
                <!-- Lumbar Actities -->
                <Grid Grid.Row="4" Margin="0,0,0,15">
                    <Grid.Style>
                        <Style TargetType="{x:Type Grid}">
                            <Style.Triggers>
                                <MultiDataTrigger>
                                    <MultiDataTrigger.Conditions>
                                        <Condition Binding="{Binding LumbarFlexExt.NeedDetailReport}" Value="False" />
                                        <Condition Binding="{Binding LumbarLateralBending.NeedDetailReport}" Value="False" />
                                        <Condition Binding="{Binding LumbarRotation.NeedDetailReport}" Value="False" />
                                    </MultiDataTrigger.Conditions>
                                    <Setter Property="Visibility" Value="Collapsed" />
                                </MultiDataTrigger>
                            </Style.Triggers>
                        </Style>
                    </Grid.Style>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>
                    <Border Grid.RowSpan="3" Width="40" Background="{StaticResource TestReportMainBackgroundBrush}">
                        <TextBlock Width="30" TextAlignment="Center" Text="腰部活动度" Style="{StaticResource TestReportTitleTextBlock}" />
                    </Border>
                    <userControl:TestResultRegularChartUserControl Grid.Column="1" VerticalAlignment="Top" Margin="0,0,0,5" DataContext="{Binding LumbarLateralBending}" />
                    <userControl:TestResultRegularChartUserControl Grid.Column="1" Grid.Row="1" Margin="0,0,0,5" DataContext="{Binding LumbarFlexExt}" />
                    <userControl:TestResultRegularChartUserControl Grid.Column="1" Grid.Row="2" VerticalAlignment="Bottom" DataContext="{Binding LumbarRotation}" />
                </Grid>
                <!-- Body Balance Activities -->
                <Grid Grid.Row="5" Margin="0,0,0,15">
                    <Grid.Style>
                        <Style TargetType="{x:Type Grid}">
                            <Style.Triggers>
                                <MultiDataTrigger>
                                    <MultiDataTrigger.Conditions>
                                        <Condition Binding="{Binding HeadBalance.NeedDetailReport}" Value="False" />
                                        <Condition Binding="{Binding ShouldersBalance.NeedDetailReport}" Value="False" />
                                        <Condition Binding="{Binding PelvicBalance.NeedDetailReport}" Value="False" />
                                    </MultiDataTrigger.Conditions>
                                    <Setter Property="Visibility" Value="Collapsed" />
                                </MultiDataTrigger>
                            </Style.Triggers>
                        </Style>
                    </Grid.Style>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>
                    <Border Grid.RowSpan="3" Width="40" Background="{StaticResource TestReportMainBackgroundBrush}">
                        <TextBlock Width="30" TextAlignment="Center" Text="身体平衡" Style="{StaticResource TestReportTitleTextBlock}" />
                    </Border>
                    <userControl:TestResultRegularChartUserControl Grid.Column="1" VerticalAlignment="Top" Margin="0,0,0,5" DataContext="{Binding HeadBalance}" />
                    <userControl:TestResultRegularChartUserControl Grid.Column="1" Grid.Row="1" Margin="0,0,0,5" DataContext="{Binding ShouldersBalance}" />
                    <userControl:TestResultRegularChartUserControl Grid.Column="1" Grid.Row="2" VerticalAlignment="Bottom" DataContext="{Binding PelvicBalance}" />
                </Grid>
            </Grid>
        </StackPanel>
        <StackPanel Grid.Row="3" Width="750" Margin="10,0,10,10">
            <TextBlock Margin="0,0,0,6" Text="参考结论：" Style="{StaticResource TestReportTextBlock}" />
            <Border Padding="2" Height="150" BorderThickness="1" BorderBrush="#153364">
                <TextBlock TextWrapping="Wrap" Text="{Binding DiagnosticMessages}" Style="{StaticResource TestReportTextBlock}" />
            </Border>
        </StackPanel>
        <Grid Grid.Row="4" TextBlock.FontSize="13" Width="750" Margin="10,5,10,4" VerticalAlignment="Bottom">
            <Grid.RowDefinitions>
                <RowDefinition Height="35" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <TextBlock Text="{Binding TestDateDisplay, StringFormat={}测试日期：{0}}" Style="{StaticResource TestReportTextBlock}" />
            <TextBlock Text="操作员签字：" Margin="0,0,120,0" HorizontalAlignment="Right" TextWrapping="Wrap" Style="{StaticResource TestReportTextBlock}" />
            <TextBlock Grid.Row="1" Text="{Binding SerialNumber}" Style="{StaticResource TestReportTextBlock}" />
            <TextBlock Grid.Row="1" Text="本测量结果仅供临床医生参考，不作为诊断报告。" HorizontalAlignment="Right" Style="{StaticResource TestReportTextBlock}" />
        </Grid>
    </Grid>
</Window>